package org.demon.springtest.design.singleton;

/**
 * @author demon
 * @version 1.0.0
 */
public enum EnumSingleton {

    INSTANCE;

    private Resource instance;

    EnumSingleton() {
        System.out.println("EnumSingleton is create");
        instance = new Resource();
    }

    public Resource getInstance() {
        return instance;
    }


    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            new Thread(() -> System.out.println(EnumSingleton.INSTANCE.getInstance())).start();
        }
    }


}
